home *** CD-ROM | disk | FTP | other *** search
- /*
- ***********************************************************************
- *
- * Value Control
- * Slider with a window to show the current value
- * Behaves like a glorified integer
- *
- ***********************************************************************
- */
-
- #include "Dialog.h"
-
- class ValueControl : public BasicControl
- {
- const int small_increment; // Increments when the scrollbar is
- const int big_increment; // scrolled
- ModelessDialog::TextItem * show_val_item; // Have to use pointers (sigh) due to the late binding
-
- virtual Boolean handle_click(void);
- virtual void track_action(const int part_no);
- void show_curr_value(void); // Show the current value of the control in a special window
-
- public:
- ValueControl(const int _big_increment = 10, const int _small_increment = 1) :
- big_increment(_big_increment), small_increment(_small_increment), show_val_item(0) {}
- void bind(const ModelessDialog::ControlItem& control_item,
- const ModelessDialog::TextItem& value_item); // Late constructor
- ~ValueControl(void);
-
- // That's what makes a ValueControl a glorified int
- operator int (void) const { return GetControlValue(our_control()); }
- // friend inline int operator = (ValueControl& vc, const short value)
- // { SetControlValue(our_control(),value); return value; }
- int get_min(void) const { return GetControlMinimum(our_control()); }
- int get_max(void) const { return GetControlMaximum(our_control()); }
- };
-